require(['monitor'], function () {

    $('#monitor').monitor({
        canId: '24',
        onlyOnce: true,
        callback: function (data) {
            loadData(data);
        }
    });

    function loadData(data) {
        $("#playPumpClass").setViewData(data, 'id');
        $("#pumpSt").setView(data.pumpSt, [
            {value: 1, css: 'green', text: '控制电源接通'},
            {value: 0, css: 'green', text: '就绪'},
            {value: 7, css: 'green', text: '诊断和标定'},
            {value: 5, css: 'red', text: '故障'},
            {value: 900, css: 'red', text: '准备就绪'},
            {value: 901, css: 'red', text: '运行状态'},
            {value: 902, css: 'red', text: '系统故障'},
            {value: 1120, css: 'red', text: '准备就绪'},
            {value: 1121, css: 'red', text: '运行状态'},
            {value: 1122, css: 'red', text: '系统故障'}
        ]);

        $("#errorLevel").setView(data.errorLevel, [
            {value: 0, text: '-'},
            {value: 1, css: 'red', text: '一级故障（严重故障）'},
            {value: 2, css: 'red', text: '二级故障（普通故障）'},
            {value: 3, css: 'red', text: '三级故障（报警故障）'}
        ]);

        $("#coolSt").setView(data.coolSt, [
            {value: 0, css: 'red', text: '关闭'},
            {value: 1, css: 'green', text: '开启'}
        ]);
    }

});